<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
	<title>物业公司单位</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel="stylesheet" type="text/css" href="../../css/style.css">
	<script type="text/javascript" src="../../js/jquery-1.8.2.js"></script>
	<script type="text/javascript" src="../../js/dialog/jquery.artDialog.source.js?skin=default"></script>
	<script type="text/javascript" src="../../js/dialog/plugins/iframeTools.source.js"></script>
	<script type="text/javascript" src="../../js/jquery.ztree.all-3.5.min.js"></script>
	<script type="text/javascript" src="../../js/datepicker/WdatePicker.js"></script>
	<script type="text/javascript" src="../../js/jquery.form.js"></script>
	<script type="text/javascript" src="../../js/jquery.page.js"></script>
	<script type="text/javascript" src="../../js/base.js"></script>
	<style>
	.inputText{padding:1px;}
	</style>
</head>
<body class="app">
	<h3>物业公司单位</h3>
	<form class="search" id="search" name="search" method="post">
		<div class="tbdiv">
		<table>
			<tr>
				<th width="100">上级单位：</th>
				<td><select name="propertyUpUnit"></select></td>
				<th width="100">物业单位编号：</th>
				<td width="100"><input type="text" class="inputText" name="propertyCode" style="width:100px;"/></td>
				<th width="100">物业单位名称：</th>
				<td width="100"><input type="text" class="inputText" name="propertyName" style="width:100px;"/></td>
				<td width="100" align="right"><input type="submit" value="查询" class="inputButton"/></td>
			</tr>
		</table>
		</div>
	</form>
	<div id="list"></div>
	<div class="optionlink">
		<span id="btnAdd">【添加信息】</span>
		<span id="btnDel">【删除所选】</span>
	</div>
	<div id="view" style="width:500px;display:none;">
		<form id="saveForm" name="saveForm" action="wygsdw_save.action" method="post">
		<input type="hidden" name="propertyId"/>
		<input type="hidden" name="propertyFlag"/>
		<input type="hidden" name="propertyAddDate"/>
		<input type="hidden" name="propertyDeleteDate"/>
		<input type="hidden" name="propertyGrade"/>
		<dl class="view" style="margin-top:5px;">
			<dt>物业单位编号：</dt>
			<dd id="lh_propertyCode">
				<input type="text" class="inputText" name="propertyCode" style="width:110px;" />
			</dd>
			<dt>上级单位：</dt>
			<dd>
				<select class="inputText" name="propertyUpUnit" style="width:124px;"></select>
			</dd>
			<dt>物业单位名称：</dt>
			<dd>
				<input type="text" class="inputText" name="propertyName" style="width:110px;" />
			</dd>
			<dt>物业地址：</dt>
			<dd>
				<input type="text" class="inputText" name="propertyAddress" style="width:120px;" />
			</dd>
			<dt>联系电话：</dt>
			<dd>
				<input type="text" class="inputText" name="propertyPhone" style="width:110px;" />
			</dd>
			<dt>传真号码：</dt>
			<dd>
				<input type="text" class="inputText" name="propertyFax" style="width:120px;" />
			</dd>
			<dt>E-mail：</dt>
			<dd>
				<input type="text" class="inputText" name="propertyEmail" style="width:110px;" />
			</dd>
			<dt>网站：</dt>
			<dd>
				<input type="text" class="inputText" name="propertyWeb" style="width:120px;" />
			</dd>
			<dt class="giant" style="height:68px;">物业单位简介：</dt>
			<dd class="giant" style="height:68px;">
				<textarea class="inputText" name="propertyUnitIntro" style="width:365px;height:60px;"></textarea>
			</dd>
			<div class="cl"></div>
		</dl>
		</form>
	</div>
	
	<script type="text/javascript">
	var view = function(data){
		$('#saveForm').resetForm();
		document.saveForm.propertyId.value = "";
		document.saveForm.propertyFlag.value = "";
		document.saveForm.propertyAddDate.value = "";
		document.saveForm.propertyDeleteDate.value = "";
		document.saveForm.propertyGrade.value = "";
		$.dialog({
			id:'viewdialog',
			title:'信息查看-物业公司单位',
			lock:true,
			zIndex:99,
			padding:'5px 8px 5px 5px',
			width:'100%',
			height:'100%',
			content:document.getElementById('view'),
			button:[{
				name:"保存",
				focus:true,
				callback:function(){
					$('#saveForm').submit();
				}
			}]
		});
		if(data!=null){
			$('#lh_propertyCode').html('<label name="propertyCode"></label>');
		}else{
			$('#lh_propertyCode').html('<input type="text" class="inputText" name="propertyCode" style="width:110px;" />');
		}
		$('#saveForm').json2form(data);
	}
	$(function(){
		$('select[name=propertyUpUnit]').selectload('../../common/propertyunit_select.action','propertyCode','propertyName');
		$('#saveForm').ajaxForm({
			success:function(data){
				$('#list').page('show');
			}
		});
		//分页列表
		$('#list').page({
			url:'wygsdw_search.action',
			config:'pageinfo,record,first,last,next,prev,jump',
			items:[{
				name:'propertyId',
				type:'checkbox',
				width:13
			},{
				title:'物业单位编号',
				name:'propertyCode'
			},{
				title:'物业单位名称',
				name:'propertyName'
			},{
				title:'联系电话',
				name:'propertyPhone'
			},{
				title:'详情',
				render:function(row){
					$a = $('<a href="javascript:void(0)")">【详细】</a>');
					$a.click(function(){
						view(row);
					});
					return $a;
				}
			}]
		});

		$('#btnAdd').click(function(){
			view(null);
		});
		$('#btnDel').click(function(){
			$.dialog.confirm('您确认删除所选单位吗？',function(){
				var ids = $('#list').data('checked').join(',');
				$.post('wygsdw_del.action',{ids:ids},function(data){
					$('#list').page('show');
				});
			});
		})
		$('#saveForm').ajaxForm({
			success:function(data){
				$('#list').page('show');
			}
		});
	});
	</script>
</body>
</html>